<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
	<title>模板标签</title>
	<style type="text/css">
	
	ul {
		list-style: none;
		margin: 10px 0;
		border: 1px dotted #aaa;
	}

	li{
		widows: 300px;
		padding: 5px 0;
	}

    </style>
</head>
<body>
	<div class="container">
		<h1>模板标签</h1>
		<div id="box">
			
		</div>
	</div>
<script src="https://cdn.staticfile.org/jquery/3.2.0/jquery.js"></script>
<script type="text/javascript">

// 模板标签
var lesson = 'javascript'	
var str = tag `${lesson}`
function tag(strings, lesson, a) {
	// ["", "", raw: Array[2]] "javascript" undefined
	// 普通字符串长度 大于变量个数
	console.log(strings, lesson, a)
	console.log(arguments)
}

var lessons = ['css', 'javascript'	]
var [lesson1, lesson2] = lessons
var str = tag2 `学习${lesson1}, study${lesson2} !!!`
function tag2(strings, lesson1, lesson2, ...args) {
	console.log(strings, lesson1, lesson2, ...args)
	console.log(	arguments)
	
}


</script>
</body>
</html>